﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RandomGeneratorAsp
{
    public partial class Generator : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ButtonSubmit_Click(object sender, EventArgs e) 
        {
            int lowerBound;
            int upperBound;

            int.TryParse(this.lowerBound.Text, out lowerBound);
            int.TryParse(this.upperBound.Text, out upperBound);

            Random generator = new Random();
            int result = generator.Next(lowerBound, upperBound);
            Response.Write("Result: "+ result.ToString());
        }
    }
}